Add TitleBar drag-region APIs (WinApp SDK 2.1.3 uptake)#723
Open
azchohfi wants to merge 5 commits into
Open
Conversation
Bump Windows App SDK 2.0.1 -> 2.1.3 and surface the new Microsoft.UI.Xaml.Controls.TitleBar drag-region APIs: TitleBarElement.AutoRefreshDragRegions (auto-mapped via the wrapper generator) plus a cross-cutting .IsDragRegion(bool?) modifier applied in Reconciler.ApplyModifiers via TitleBar.SetIsDragRegion/ClearValue. Adds spec 059, unit tests, a real-WinUI selftest (TitleBar_DragRegions), gallery demo, and windowing docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The 2.1.3 framework bump left the dotnet-new template, the CLI local-scaffold csproj, and the install snippets pinning Microsoft.WindowsAppSDK 2.0.1/2.0.*. NuGet rejects that as a downgrade (NU1605) against the framework's new >= 2.1.3 dependency, failing the Integration Tests (template smoke) and bootstrap.ps1 CI jobs. These standalone pins do not inherit the central WindowsAppSDKVersion and must be bumped in lockstep. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Addresses findings from the multi-dimensional PR review: - H1 (high): ElementModifiers.Merge dropped IsDragRegion, so .IsDragRegion() was silently lost unless it was the FIRST modifier in a chain (the shipped gallery-sample order). Wire it into Merge. Regression test added; the selftest now applies .IsDragRegion() after .Width() to exercise it end-to-end. - H2 (high): ModifiersEqual omitted IsDragRegion, so the reconciler skip fast-path collapsed runtime toggles. Add it to the comparison (+ unit test). - M1: ElementPool.CleanElement now clears TitleBar.IsDragRegionProperty so a pooled control can't carry a stale value to the next renter. - M5: CHANGELOG entry (spec 059). M6: pack the reactor-windowing agent-kit skill (was absent from the pack list, so its docs would not ship). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Reactor to Windows App SDK 2.1.3 and surfaces the WinUI TitleBar drag-region APIs in a declarative Reactor-friendly way: a TitleBarElement.AutoRefreshDragRegions property + fluent modifier, and a cross-cutting .IsDragRegion(...) modifier backed by TitleBar.IsDragRegion.
Changes:
- Bump Windows App SDK pins across the repo (central
WindowsAppSDKVersion+ template/scaffold/docs literals) to 2.1.3. - Add
TitleBarElement.AutoRefreshDragRegions+.AutoRefreshDragRegions()sugar and wireTitleBar.IsDragRegionas anElementModifiers-backed attached-property modifier applied by the reconciler (and cleared by pooling). - Add unit tests + a selftest fixture, and update docs/samples/skills + API index.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Templates/templates/WinUIApp-CSharp/Company.ReactorApp1.csproj | Template pin updated to WinApp SDK 2.1.3 |
| tests/Reactor.Tests/ElementModifiersCoverageTests.cs | Unit coverage for .IsDragRegion() modifier plumbing |
| tests/Reactor.Tests/ElementExtensionsCoverageTests.cs | Unit coverage for .AutoRefreshDragRegions() sugar |
| tests/Reactor.AppTests.Host/SelfTest/SelfTestFixtureRegistry.cs | Registers new TitleBar_DragRegions selftest fixture |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/Phase7WindowingFixtures.cs | Adds TitleBar_DragRegions selftest implementation |
| src/Reactor/Reactor.csproj | Packs the new reactor-windowing skill markdown into agentkit payload |
| src/Reactor/Elements/ElementExtensions.cs | Adds .AutoRefreshDragRegions() and .IsDragRegion() modifiers |
| src/Reactor/Core/Reconciler.cs | Applies/clears the TitleBar.IsDragRegion attached property via modifiers |
| src/Reactor/Core/ElementPool.cs | Clears TitleBar.IsDragRegion on pooled controls to prevent state bleed |
| src/Reactor/Core/Element.cs | Adds IsDragRegion to ElementModifiers + merge/equality; adds AutoRefreshDragRegions to TitleBarElement |
| src/Reactor.Cli/Program.cs | Updates scaffolded csproj literal to WinApp SDK 2.1.3 |
| skills/reactor.api.txt | Updates API index for new modifiers/properties |
| SKILL.md | Updates WinApp SDK version snippet to 2.1.3 |
| samples/WinFormsInterop/README.md | Updates WinApp SDK version snippet to 2.1.3 |
| samples/ReactorGallery/ControlPages/Navigation/TitleBarPage.cs | Demonstrates .IsDragRegion(false) + .AutoRefreshDragRegions() |
| plugins/reactor/skills/reactor-windowing/SKILL.md | Documents drag regions + new modifiers in the windowing skill |
| plugins/reactor/skills/reactor-dsl/references/reactor.api.txt | Updates embedded API reference for the DSL skill |
| docs/specs/059-titlebar-drag-regions.md | Adds design spec for WinApp SDK 2.1.3 drag-region uptake |
| docs/guide/windows.md | Documents drag regions usage in the Windows guide |
| docs/guide/README.md | Updates WinApp SDK version snippet to 2.1.* |
| docs/guide/index.md | Updates WinApp SDK version snippet to 2.1.* |
| docs/_pipeline/templates/windows.md.dt | Updates Windows guide template with drag regions section |
| docs/_pipeline/templates/index.md.dt | Updates index template WinApp SDK snippet to 2.1.* |
| Directory.Build.props | Central bump to WindowsAppSDKVersion 2.1.3 |
| CHANGELOG.md | Adds changelog entry for TitleBar drag regions + SDK bump |
| bootstrap.ps1 | Updates comment to reflect SDK 2.1.3 runtime expectation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Make .IsDragRegion accept bool? (tri-state) so callers can forward a nullable state directly and match the documented .IsDragRegion(bool?) shape; api index updated.
- Parenthesize the 'with { ... }' expression before .AutoRefreshDragRegions() in every doc/skill/spec/sample snippet — member access on a with-expression needs parentheses, so the snippets now compile when copy/pasted (the compiled gallery code was already correct; only its displayed string was missing them).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Record that the 2.0.1 -> 2.1.3 bump raises every consumer's WindowsAppSDK floor, the reflection-guarded mitigation that was considered, and the rationale for accepting the bump (in-place servicing within the same side-by-side 2.x runtime family). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Surveyed the Windows App SDK 2.x release notes for APIs Reactor could leverage, and adopted the one that lands squarely on an existing surface: the
Microsoft.UI.Xaml.Controls.TitleBardrag-region APIs added in 2.1.3. Design is captured in spec 059.Reactor's
TitleBarElementalready maps directly toWinUI.TitleBarand exposes a userContentslot (the gallery sample puts anAutoSuggestBox+Buttonthere) — the exact mixed interactive/non-interactive scenario these APIs target.Changes
WindowsAppSDKVersion2.0.1 → 2.1.3 (in-place servicing within the shared major-2 runtime family; aligns with the runtime already pinned in the perf CI script). Inherits the 2.1.3 default that auto-excludes interactive controls fromTitleBar.Contentdrag regions..AutoRefreshDragRegions()onTitleBarElement— auto-maps through the wrapper generator (descriptor-only auto-discovery emits.OneWay<bool>(e => e.AutoRefreshDragRegions, …)). Defaultfalse(matches WinUI)..IsDragRegion(bool? )— cross-cutting modifier on any element (true= draggable,false= clickable). Stored onElementModifiers, applied inReconciler.ApplyModifiersviaTitleBar.SetIsDragRegion/ClearValue, mirroring.IsTabStop()/AutomationName. Inert outside a title bar.RecomputeDragRegions()intentionally not surfaced — the declarativeAutoRefreshDragRegionscovers the reactive case (spec 059 §4.3).Verification
TitleBar_DragRegions: confirmsAutoRefreshDragRegionsround-trips onto the control and.IsDragRegion(false)writes the attached property on a child. All TitleBar selftests green.Also updated
bootstrap.ps1version comment, galleryTitleBarPagedemo, windowing skill +windows.mdguide (template + recompiled), and the API index (reactor.api.txt).Considered but deferred (2.2.0)
XamlBindingHelperboxing-free value setters,Setter.ValueProperty, andApplicationData.GetForUnpackaged()— see spec 059 §5.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com